package org.springblade.system.user.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.entity.UserDept;
import org.springblade.system.user.service.IUserDeptService;
import org.springblade.system.user.service.IUserService;
import org.springblade.system.user.vo.UserVO;
import org.springblade.system.user.wrapper.UserWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ZH
 */
@RestController
@RequestMapping("/synchronizedData")
@AllArgsConstructor
@Slf4j
public class SynchronizedDataController {
	private IUserService userService;
	private IUserDeptService userDeptService;

	/**
	 * 查询所有用户
	 */
	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "查询所有用户", notes = "")
	@GetMapping("/getAllUserList")
	public R<List<User>> getAllUserList() {
		return R.data(userService.list());
	}
	/**
	 * 查询所有部门关联
	 */
	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "查询所有用户", notes = "")
	@GetMapping("/getAllUserDeptList")
	public R<List<UserDept>> getAllUserDept() {
		return R.data(userDeptService.list());
	}
}
